<head>
<link type="text/css" rel="stylesheet" href="../bovenschrift.css" />
<script src="../bovenschrift.js"></script>
<script>
<?php
   require_once "../../../_PHPscripts/basisfuncties.php";
   $iNr = $_GET["iNr"];
   $sqlZin =<<<SQL
     select distinct jaar,periode,
       case when periode = 'm1' then '1 Maandrapport 1   ' 
	        when periode = 'm2' then '2 Maandrapport 2   ' 
	        when periode = 't1' then '3 Semesterrapport 1'  
	        when periode = 'm3' then '4 Maandrapport 3   ' 
	        when periode = 'm4' then '5 Opbouwtoetsen 12  '  
	        when periode = 'm5' then '6 Opbouwtoetsen 4 ' 
	        when periode = 't2' then '7 Semesterrapport 2' 
       end as volgorde 
     from fr_XML  
     where aard='v' and inschrijvingsNr = '$iNr' 
     order by jaar,volgorde 
SQL;
	$conn = odbc_connect($rapportDB, '', '');
	$rs = odbc_exec($conn, $sqlStr);
	$i = 0;
	while (odbc_fetch_row($rs)){
	  echo " titels[".$i."] = '".odbc_result($rs,'volgorde')."';";
    echo " jaren[".$i."] = '".odbc_result($rs,'jaar')."';";
	  echo " periodes[".$i."] = '".odbc_result($rs,'periode')."';";
    $i++;
  }
	odbc_close($conn);
	echo "aantalTitels = ".$i.";";
?>  

function roep()
{ if (jaren[nrTitel] == ''){return}
  parent.rapport.location = "geefRapport.asp?iNr=<?php echo $_GET['iNr'] ?>" 
    + "&periode= periodes[nrTitel] 
    +	"&jaar= jaren[nrTitel];
}

</script>
</head>
<body onLoad="toonEerst();" bgcolor="#DDDDDD">

<table border=0 cellspacing=0 cellpadding=0>
<tr width="100%">
<td align="left"> &nbsp; &nbsp; &nbsp; </td>
<td align="right"><button onClick="vorig()"> << </button></td>
<th><b><span id="dePeriode"></span></b></th>
<td align="left"><button onClick="volgend()"> >> </button> &nbsp;</td>
<th align="right">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b>Vakrapporten</b> </th>
<td><input type=hidden name="iNr"></td>
<td><input type=hidden name="jaar"></td>
<td><input type=hidden name="periode"></td>
</tr>
</table>
</body>